body {
    margin: 0;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    background-color: #f0f0f0;
    font-family: Arial, sans-serif;
}

.game-wrapper {
    display: flex;
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.game-container {
    background-color: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.difficulty-select {
    padding: 8px;
    font-size: 16px;
    border: 2px solid #4CAF50;
    border-radius: 5px;
    cursor: pointer;
    outline: none;
}

#gameCanvas {
    border: 2px solid #333;
    background-color: #fff;
}

.game-info {
    margin-top: 20px;
    text-align: center;
}

.score {
    font-size: 24px;
}

#startButton {
    padding: 10px 20px;
    font-size: 16px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

#startButton:hover {
    background-color: #45a049;
}

/* 排行榜样式 */
.leaderboard {
    background-color: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    min-width: 300px;
}

.leaderboard h2 {
    text-align: center;
    color: #333;
    margin-top: 0;
}

.leaderboard-difficulty {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
}

.leaderboard-tab {
    flex: 1;
    padding: 8px;
    border: none;
    background: #f0f0f0;
    cursor: pointer;
    transition: background-color 0.3s;
}

.leaderboard-tab.active {
    background: #4CAF50;
    color: white;
}

.leaderboard-content {
    max-height: 400px;
    overflow-y: auto;
}

#leaderboardTable {
    width: 100%;
    border-collapse: collapse;
}

#leaderboardTable th,
#leaderboardTable td {
    padding: 10px;
    text-align: center;
    border-bottom: 1px solid #ddd;
}

#leaderboardTable th {
    background-color: #f5f5f5;
    font-weight: bold;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background-color: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    max-width: 400px;
    width: 90%;
}

.modal h2 {
    margin-top: 0;
    color: #333;
}

.input-group {
    margin: 20px 0;
}

#playerName {
    padding: 8px;
    font-size: 16px;
    border: 2px solid #4CAF50;
    border-radius: 5px;
    margin-right: 10px;
}

#submitScore,
#playAgain {
    padding: 8px 16px;
    font-size: 16px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

#submitScore:hover,
#playAgain:hover {
    background-color: #45a049;
}

/* 响应式布局 */
@media (max-width: 768px) {
    .game-wrapper {
        flex-direction: column;
    }
    
    .leaderboard {
        margin-top: 20px;
    }
}